/*
 * @Author: swc shanwenchao12138@163.com
 * @Date: 2025-01-14 09:20:21
 * @LastEditors: swc
 * @LastEditTime: 2025-01-21 10:43:39
 * @FilePath: \my\src\components\custom\myFlow\types.ts
 * @Description:
 * @Version: 2.0
 * @Autor: swc
 */
import { Node } from '@antv/x6';
import Vue from 'vue';
/* import {} from '@/types' */
/*
 * props
 */
export namespace N_cPflow {
  export interface cPflow extends Vue {}
  // 工艺槽数据接口
  export interface TankData {
    id: string;
    tankId: string;
    tankName: string;
    tankNumber: string;
  }

  // 工艺参数数据接口
  export interface ParamData {
    id: string;
    paramId: string;
    paramName: string;
    paramValue: number | string | boolean;
    paramType?: 0 | 1; // 新增类型字段
    minValue?: string; // 字符串形式存储
    maxValue?: string; // 字符串形式存储
  }
  // 主节点数据接口
  export interface ProcessNodeData {
    // 工序创建ID
    id: string;
    // 工序基础数据ID
    processId: string;
    sequence: number;
    processCode: string;
    processName: string;
    tankData: TankData[];
    paramData: ParamData[];
  }

  // 右键菜单接口
  export interface ContextMenu {
    visible: boolean;
    x: number;
    y: number;
    nodeId?: string;
  }

  // 节点配置接口
  export interface NodeConfig {
    width: number;
    height: number;
    padding: number;
    rowSpacing: number;
    columnSpacing: number;
  }
  export interface ProcessDialogForm {
    sequence: number;
    processCode: string;
    processName: string;
  }

  export interface ProcessDialog {
    visible: boolean;
    form: ProcessDialogForm;
    rules: any;
    currentNode: Node | null;
  }

  export interface TooltipData {
    visible: boolean;
    x: number;
    y: number;
    title: string;
    tankData: TankData[];
    paramData: ParamData[];
  }

  export interface NodeParamsInfo extends TooltipData {
    id: string;
    style: {
      position: string;
      left: string;
      top: string;
      width: string;
    };
  }
  // 预设节点模板接口
  export interface PresetNode {
    id: string;
    name: string;
    data: ProcessNodeData;
  }
}
